<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // 校验qq账号
    var req = /^[1-9]\d{4,11}$/;
    var Qnum = '083674678';
    console.log('QQ账号：'+Qnum);
    // console.log(re.test(num));
    if(req.test(Qnum)){
        console.log('yes'+Qnum);
    }
    else{
        console.log('no');
    }
    
    // 校验密码
    var rep = /^\w{5,19}$/;
    var pwd = 'hello123';
    console.log('密码：'+pwd);
    if(rep.test(pwd)){
        console.log('yes');
    }
    else{
        console.log('no');
    }

    // 校验用户名
    var ren = /^[a-zA-Z]\w{5,15}$/;
    var uname = 'wzxhhhh';
    console.log('用户名：'+uname);
    if(ren.test(uname)){
        console.log('yes');
    }
    else{
        console.log('no');
    }

    // 校验身份证号码
    var rei = /^[1-9]\d{5}\d{4}\d{2}\d{2}\d{3}[0-9X]$/;
    var uid = '11010120001010051X';
    console.log('身份证号码：'+uid);
    if(rei.test(uid)){
        console.log('yes');
    }else{
        console.log('no');
    }
</script>
</html>